package model

import (
	"gorm.io/gorm"
	"time"
)

type Friend struct {
	Id        uint           `gorm:"column:id;type:bigint(20) UNSIGNED;primaryKey;not null;" json:"id"`
	UserOne   uint           `gorm:"column:user_one;type:bigint(20) UNSIGNED;comment:用户1;not null;default:0;" json:"user_one"` // 用户1
	UserTwo   uint           `gorm:"column:user_two;type:bigint(20) UNSIGNED;comment:用户2;not null;default:0;" json:"user_two"` // 用户2
	Status    int32          `gorm:"column:status;type:int(10);comment:1:发起申请 2:同意 3:拒绝;not null;" json:"status"`              // 1:发起申请 2:同意 3:拒绝
	CreatedAt time.Time      `gorm:"column:created_at;type:datetime(3);not null;" json:"created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (f *Friend) TableName() string {
	return "friend"
}
